package com.kly.chatter.api.application.controller.chatter.res;

import com.kly.chatter.db.entity.ChatterDashboardInfoEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.List;

@Data
@ApiModel(description = "Dashboard 返回参数")
public class DashboardRes implements Serializable {

    @ApiModelProperty(value = "Chatter等级 1.SS 2.S 3.A 4.B")
    private Integer chatterRating;

    @ApiModelProperty(value = "总收入")
    private BigDecimal totalIncome;

    @ApiModelProperty(value = "周日期 09/01-0907")
    private String weekDay;

    @ApiModelProperty(value = "聊天人数")
    private Integer chats;

    @ApiModelProperty(value = "新聊天人数")
    private Integer newChats;

    @ApiModelProperty(value = "回复率")
    private BigDecimal timelyResponseRate;

    @ApiModelProperty(value = "回复率阀值")
    private Integer timelyResponseLimit;

    @ApiModelProperty(value = "在线率")
    private BigDecimal onlineRate;

    @ApiModelProperty(value = "新建联承接率")
    private BigDecimal acceptanceRate;

    @ApiModelProperty(value = "新建联承接率阀值")
    private Integer acceptanceLimit;

    @ApiModelProperty(value = "私密照片收入")
    private BigDecimal privatePhotos;

    @ApiModelProperty(value = "私密照片奖励")
    private BigDecimal privatePhotosReward;

    @ApiModelProperty(value = "私密照片个数")
    private Integer privatePhotosCount;

    @ApiModelProperty(value = "私密视频个数")
    private Integer privateVideosCount;

    @ApiModelProperty(value = "私密照片收入")
    private BigDecimal privateVideos;

    @ApiModelProperty(value = "私密视频奖励")
    private BigDecimal privateVideosReward;

    @ApiModelProperty(value = "深度会话奖励")
    private BigDecimal deepSession;

    @ApiModelProperty(value = "聊天人数")
    private BigDecimal rankingRewards;

    @ApiModelProperty(value = "评级进度信息")
    private RewardLevelInfoRes rewardLevelInfoRes;

    @ApiModelProperty(value = "评级等级信息")
    private List<RewardLevelConfigRes> rewardLevelConfigResList;

    @ApiModelProperty(value = "考勤进度")
    private List<ChatterWeekStatusRes> ChatterWeekStatusResList;

    @ApiModelProperty(value = "清理缓存提示")
    private String cleanCacheTips;

    public static DashboardRes toRes(ChatterDashboardInfoEntity chatterDashboardInfo) {
        DashboardRes dashboardRes = new DashboardRes();
        if (chatterDashboardInfo != null) {
            dashboardRes.setTotalIncome(chatterDashboardInfo.getTotalIncome());
            dashboardRes.setChats(chatterDashboardInfo.getChats());
            dashboardRes.setNewChats(chatterDashboardInfo.getNewChats());
            dashboardRes.setTimelyResponseRate(chatterDashboardInfo.getTimelyResponseRate());
            dashboardRes.setOnlineRate(chatterDashboardInfo.getOnlineRate());
            dashboardRes.setPrivatePhotos(chatterDashboardInfo.getPrivatePhotos());
            dashboardRes.setPrivatePhotosReward(chatterDashboardInfo.getPrivatePhotosReward());
            dashboardRes.setPrivateVideos(chatterDashboardInfo.getPrivateVideos());
            dashboardRes.setPrivateVideosReward(chatterDashboardInfo.getPrivateVideosReward());
            dashboardRes.setDeepSession(chatterDashboardInfo.getDeepSession());
            dashboardRes.setRankingRewards(chatterDashboardInfo.getRankingRewards());
            dashboardRes.setPrivatePhotosCount(chatterDashboardInfo.getPrivatePhotosCount());
            dashboardRes.setPrivateVideosCount(chatterDashboardInfo.getPrivateVideosCount());
            dashboardRes.setTimelyResponseLimit(chatterDashboardInfo.getTimelyResponseLimit());
            dashboardRes.setAcceptanceRate(chatterDashboardInfo.getAcceptanceRate());
            dashboardRes.setAcceptanceLimit(chatterDashboardInfo.getAcceptanceLimit());
        }
        return dashboardRes;
    }
}
